home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / basic / ace24dist.lha / ace24.lha / include / devices / printer.h < prev    next >
C/C++ Source or Header  |  1996-09-10  |  10KB  |  240 lines

  1. #ifndef     DEVICES_PRINTER_H
  2. #define     DEVICES_PRINTER_H 1
  3. /*
  4. ** printer.h for ACE Basic
  5. **
  6. ** Note: Translated to ACE by ConvertC2ACE
  7. **       @ MapMeadow Software, Nils Sjoholm
  8. **
  9. **
  10. ** Date: 09/03/95
  11. **
  12. **
  13. */
  14.  
  15. /*
  16. ** This are the StructPointer defines for printer.h
  17. */
  18. #ifndef IODRPReqPtr
  19. #define IODRPReqPtr ADDRESS
  20. #endif
  21. #ifndef IOPrtCmdReqPtr
  22. #define IOPrtCmdReqPtr ADDRESS
  23. #endif
  24. /*
  25. ** End of StructPointer defines for printer.h
  26. */
  27.          
  28. #ifndef  EXEC_TYPES_H
  29. #include <exec/types.h>
  30. #endif
  31.  
  32. #ifndef  EXEC_NODES_H
  33. #include <exec/nodes.h>
  34. #endif
  35.  
  36. #ifndef  EXEC_LISTS_H
  37. #include <exec/lists.h>
  38. #endif
  39.  
  40. #ifndef  EXEC_PORTS_H
  41. #include <exec/ports.h>
  42. #endif
  43.  
  44.  
  45. #define  PRD_RAWWRITE      (CMD_NONSTD+0)
  46. #define  PRD_PRTCOMMAND    (CMD_NONSTD+1)
  47. #define  PRD_DUMPRPORT     (CMD_NONSTD+2)
  48. #define  PRD_QUERY     (CMD_NONSTD+3)
  49.  
  50. /* printer command definitions */
  51.  
  52. #define aRIS     0  /* ESCc  reset            ISO */
  53. #define aRIN     1  /* ESC#1 initialize       +++ */
  54. #define aIND     2  /* ESCD  lf           ISO */
  55. #define aNEL     3  /* ESCE  return, lf            ISO */
  56. #define aRI  4  /* ESCM  reverse lf       ISO */
  57.  
  58. #define aSGR0    5  /* ESC[0m normal BYTE set         ISO */
  59. #define aSGR3    6  /* ESC[3m italics on          ISO */
  60. #define aSGR23   7  /* ESC[23m italics off        ISO */
  61. #define aSGR4    8  /* ESC[4m underline on        ISO */
  62. #define aSGR24   9  /* ESC[24m underline off          ISO */
  63. #define aSGR1   10  /* ESC[1m boldface on         ISO */
  64. #define aSGR22  11  /* ESC[22m boldface off       ISO */
  65. #define aSFC    12  /* SGR30-39  set foreground color ISO */
  66. #define aSBC    13  /* SGR40-49  set background color ISO */
  67.  
  68. #define aSHORP0 14  /* ESC[0w normal pitch        DEC */
  69. #define aSHORP2 15  /* ESC[2w elite on            DEC */
  70. #define aSHORP1 16  /* ESC[1w elite off       DEC */
  71. #define aSHORP4 17  /* ESC[4w condensed fine on       DEC */
  72. #define aSHORP3 18  /* ESC[3w condensed off       DEC */
  73. #define aSHORP6 19  /* ESC[6w enlarged on         DEC */
  74. #define aSHORP5 20  /* ESC[5w enlarged off        DEC */
  75.  
  76. #define aDEN6   21  /* ESC[6"z shadow print on        DEC (sort of) */
  77. #define aDEN5   22  /* ESC[5"z shadow print off       DEC */
  78. #define aDEN4   23  /* ESC[4"z doublestrike on        DEC */
  79. #define aDEN3   24  /* ESC[3"z doublestrike off       DEC */
  80. #define aDEN2   25  /* ESC[2"z  NLQ on            DEC */
  81. #define aDEN1   26  /* ESC[1"z  NLQ off       DEC */
  82.  
  83. #define aSUS2   27  /* ESC[2v superscript on          +++ */
  84. #define aSUS1   28  /* ESC[1v superscript off         +++ */
  85. #define aSUS4   29  /* ESC[4v subscript on        +++ */
  86. #define aSUS3   30  /* ESC[3v subscript off       +++ */
  87. #define aSUS0   31  /* ESC[0v normalize the line      +++ */
  88. #define aPLU    32  /* ESCL  partial line up          ISO */
  89. #define aPLD    33  /* ESCK  partial line down        ISO */
  90.  
  91. #define aFNT0   34  /* ESC(B US BYTE set    or Typeface  0 (default) */
  92. #define aFNT1   35  /* ESC(R French BYTE set    or Typeface  1 */
  93. #define aFNT2   36  /* ESC(K German BYTE set    or Typeface  2 */
  94. #define aFNT3   37  /* ESC(A UK BYTE set    or Typeface  3 */
  95. #define aFNT4   38  /* ESC(E Danish I BYTE set  or Typeface  4 */
  96. #define aFNT5   39  /* ESC(H Sweden BYTE set    or Typeface  5 */
  97. #define aFNT6   40  /* ESC(Y Italian BYTE set   or Typeface  6 */
  98. #define aFNT7   41  /* ESC(Z Spanish BYTE set   or Typeface  7 */
  99. #define aFNT8   42  /* ESC(J Japanese BYTE set  or Typeface  8 */
  100. #define aFNT9   43  /* ESC(6 Norweign BYTE set  or Typeface  9 */
  101. #define aFNT10  44  /* ESC(C Danish II BYTE set or Typeface 10 */
  102.  
  103. /*
  104.     Suggested typefaces are:
  105.  
  106.      0 - default typeface.
  107.      1 - Line Printer or equiv.
  108.      2 - Pica or equiv.
  109.      3 - Elite or equiv.
  110.      4 - Helvetica or equiv.
  111.      5 - Times Roman or equiv.
  112.      6 - Gothic or equiv.
  113.      7 - Script or equiv.
  114.      8 - Prestige or equiv.
  115.      9 - Caslon or equiv.
  116.     10 - Orator or equiv.
  117. */
  118.  
  119. #define aPROP2  45  /* ESC[2p  proportional on        +++ */
  120. #define aPROP1  46  /* ESC[1p  proportional off       +++ */
  121. #define aPROP0  47  /* ESC[0p  proportional clear     +++ */
  122. #define aTSS    48  /* ESC[n E set proportional offset ISO */
  123. #define aJFY5   49  /* ESC[5 F auto left justify      ISO */
  124. #define aJFY7   50  /* ESC[7 F auto right justify     ISO */
  125. #define aJFY6   51  /* ESC[6 F auto full justify      ISO */
  126. #define aJFY0   52  /* ESC[0 F auto justify off       ISO */
  127. #define aJFY3   53  /* ESC[3 F letter space (justify) ISO (special) */
  128. #define aJFY1   54  /* ESC[1 F SHORTINT fill(auto center) ISO (special) */
  129.  
  130. #define aVERP0  55  /* ESC[0z  1/8" line spacing      +++ */
  131. #define aVERP1  56  /* ESC[1z  1/6" line spacing      +++ */
  132. #define aSLPP   57  /* ESC[nt  set form length n      DEC */
  133. #define aPERF   58  /* ESC[nq  perf skip n (n>0)      +++ */
  134. #define aPERF0  59  /* ESC[0q  perf skip off          +++ */
  135.  
  136. #define aLMS    60  /* ESC#9   Left margin set        +++ */
  137. #define aRMS    61  /* ESC#0   Right margin set       +++ */
  138. #define aTMS    62  /* ESC#8   Top margin set         +++ */
  139. #define aBMS    63  /* ESC#2   Bottom marg set        +++ */
  140. #define aSTBM   64  /* ESC[Pn1 Pn2r  T&B margins      DEC */
  141. #define aSLRM   65  /* ESC[Pn1 Pn2s  L&R margin       DEC */
  142. #define aCAM    66  /* ESC#3   Clear margins          +++ */
  143.  
  144. #define aHTS    67  /* ESCH    Set horiz tab          ISO */
  145. #define aVTS    68  /* ESCJ    Set vertical tabs      ISO */
  146. #define aTBC0   69  /* ESC[0g  Clr horiz tab          ISO */
  147. #define aTBC3   70  /* ESC[3g  Clear all h tab        ISO */
  148. #define aTBC1   71  /* ESC[1g  Clr vertical tabs      ISO */
  149. #define aTBC4   72  /* ESC[4g  Clr all v tabs         ISO */
  150. #define aTBCALL 73  /* ESC#4   Clr all h & v tabs     +++ */
  151. #define aTBSALL 74  /* ESC#5   Set default tabs       +++ */
  152. #define aEXTEND 75  /* ESC[Pn"x extended commands     +++ */
  153.  
  154. #define aRAW    76  /* ESC[Pn"r Next 'Pn' chars are raw +++ */
  155.  
  156. STRUCT IOPrtCmdReq  
  157.     _Message io_Message 
  158.     DevicePtr  io_Device      /* device node pointer  */
  159.     UnitPtr  io_Unit        /* unit (driver private)*/
  160.     SHORTINT   io_Command      /* device command */
  161.     BYTE    io_Flags 
  162.     BYTE    io_Error            /* error or warning num */
  163.     SHORTINT   io_PrtCommand       /* printer command */
  164.     BYTE    io_Parm0            /* first command parameter */
  165.     BYTE    io_Parm1            /* second command parameter */
  166.     BYTE    io_Parm2            /* third command parameter */
  167.     BYTE    io_Parm3            /* fourth command parameter */
  168. END STRUCT 
  169.  
  170. STRUCT IODRPReq  
  171.     _Message io_Message 
  172.     DevicePtr  io_Device      /* device node pointer  */
  173.     UnitPtr  io_Unit        /* unit (driver private)*/
  174.     SHORTINT   io_Command      /* device command */
  175.     BYTE    io_Flags 
  176.     BYTE    io_Error            /* error or warning num */
  177.     RastPortPtr  io_RastPort   /* raster port */
  178.     ColorMapPtr  io_ColorMap   /* color map */
  179.     LONGINT   io_Modes            /* graphics viewport modes */
  180.     SHORTINT   io_SrcX             /* source x origin */
  181.     SHORTINT   io_SrcY             /* source y origin */
  182.     SHORTINT   io_SrcWidth         /* source x width */
  183.     SHORTINT   io_SrcHeight        /* source x height */
  184.     LONGINT    io_DestCols         /* destination x width */
  185.     LONGINT    io_DestRows         /* destination y height */
  186.     SHORTINT   io_Special      /* option flags */
  187. END STRUCT 
  188.  
  189. #define SPECIAL_MILCOLS     &H0001  /* DestCols specified in 1/1000" */
  190. #define SPECIAL_MILROWS     &H0002  /* DestRows specified in 1/1000" */
  191. #define SPECIAL_FULLCOLS    &H0004  /* make DestCols maximum possible */
  192. #define SPECIAL_FULLROWS    &H0008  /* make DestRows maximum possible */
  193. #define SPECIAL_FRACCOLS    &H0010  /* DestCols is fraction of FULLCOLS */
  194. #define SPECIAL_FRACROWS    &H0020  /* DestRows is fraction of FULLROWS */
  195. #define SPECIAL_CENTER      &H0040  /* center image on paper */
  196. #define SPECIAL_ASPECT      &H0080  /* ensure correct aspect ratio */
  197. #define SPECIAL_DENSITY1    &H0100  /* lowest resolution (dpi) */
  198. #define SPECIAL_DENSITY2    &H0200  /* next res */
  199. #define SPECIAL_DENSITY3    &H0300  /* next res */
  200. #define SPECIAL_DENSITY4    &H0400  /* next res */
  201. #define SPECIAL_DENSITY5    &H0500  /* next res */
  202. #define SPECIAL_DENSITY6    &H0600  /* next res */
  203. #define SPECIAL_DENSITY7    &H0700  /* highest res */
  204. #define SPECIAL_NOFORMFEED  &H0800  /* don't eject paper on gfx prints */
  205. #define SPECIAL_TRUSTME     &H1000  /* don't reset on gfx prints */
  206. /*
  207.     Compute _print size,  set 'io_DestCols' and 'io_DestRows' in the calling
  208.     program's 'IODRPReq' structure and exit,  DON'T PRINT.  This allows the
  209.     calling program to see what the final print size would be in printer
  210.     pixels.  Note that it modifies the 'io_DestCols' and 'io_DestRows'
  211.     fields of your 'IODRPReq' structure.  Also,  set the print density and
  212.     update the 'MaxXDots',  'MaxYDots',  'XDotsInch',  and 'YDotsInch' fields
  213.     of the 'PrinterExtendedData' structure.
  214. */
  215. #define SPECIAL_NOPRINT     &H2000  /* see above */
  216.  
  217. #define PDERR_NOERR     0   /* clean exit,  no errors */
  218. #define PDERR_CANCEL        1   /* user cancelled print */
  219. #define PDERR_NOTGRAPHICS   2   /* printer cannot output graphics */
  220. #define PDERR_INVERTHAM     3   /* OBSOLETE */
  221. #define PDERR_BADDIMENSION  4   /* print dimensions illegal */
  222. #define PDERR_DIMENSIONOVFLOW   5   /* OBSOLETE */
  223. #define PDERR_INTERNALMEMORY    6   /* no memory for internal variables */
  224. #define PDERR_BUFFERMEMORY  7   /* no memory for print buffer */
  225. h/*
  226.     Note : this is an internal error that can be returned from the render
  227.     FUNCTION _to the printer device.  It is NEVER returned TO the user.
  228.     IF the printer device sees this ERROR it converts it 'PDERR_NOERR'
  229.     AND exits gracefully.  Refer TO the document ON
  230.     'How TO WRITE a Graphics Printer Driver' FOR more info.
  231. */
  232. #define PDERR_TOOKCONTROL   8   /* Took control in case 0 of render */
  233.  
  234. /* internal use */
  235. #define SPECIAL_DENSITYMASK &H0700  /* masks out density values */
  236. #define SPECIAL_DIMENSIONSMASK \
  237.     (SPECIAL_MILCOLS OR SPECIAL_MILROWS OR SPECIAL_FULLCOLS OR SPECIAL_FULLROWS\
  238.     OR SPECIAL_FRACCOLS OR SPECIAL_FRACROWS OR SPECIAL_ASPECT)
  239. #endif
  240.